<template>
  <h2 ref="title2">app标题</h2>
  <button @click="btn">点击app输出</button>
  <button @click="btn1">打印组件</button>


  <Person ref="ren" />
</template>
<script lang="ts" setup name="App">
import Person from "./components/Person.vue";

import { ref } from "vue";

// 创建和title2一样的ref,用于存储ref标记的内容
let title2 = ref();
function btn() {
  console.log(title2.value);
}



let ren = ref()
function btn1(){
  console.log(ren.value)
}
</script>
<style>
#app {
  width: 100%;
  background-color: red;
  min-height: 100px;
}
</style>
